package Statistics;

import java.util.Comparator;
import java.util.HashMap;
import java.io.Serializable;

/**
 * @author Xenophon
 * @version 2009-12-27
 *
 */
public class IDGraphNode implements Serializable{
	private String id;
	private HashMap<String, Integer> inEdges = new HashMap<String, Integer>();
	private HashMap<String, Integer> outEdges = new HashMap<String, Integer>();
	
	
	public IDGraphNode(String id)
	{
		this.id = id;
	}
	
	public void SetInEdges(HashMap<String, Integer> inpool)
	{
		inEdges = inpool;
	}
	
	public void AddOutFriend(String Friend,Integer count)
	{
		outEdges.put(Friend, count);
	}
	
	public int GetInDegree()
	{
		return inEdges.size();
	}
	
	public int GetOutDegree()
	{
		return outEdges.size();
	}
	
	public String GetID()
	{
		return id;
	}
	
	public HashMap<String, Integer> GetOutEdges()
	{
		return outEdges;
	}
	
	public HashMap<String, Integer> GetInEdges()
	{
		return inEdges;
	}
	
	//Just for test
	public void AddOutEdge(String id)
	{
		if(outEdges.containsKey(id))
			return;
		outEdges.put(id, 1);
	}
	
	public void AddInEdge(String id)
	{
		if(inEdges.containsKey(id))
			return;
		inEdges.put(id, 1);
	}
	
}
